#!/bin/bash
if [ -n "$1" ] ; then
  data_str=$1
else
  data_str=`date -d "-1 days" +%F`
fi



HDFS_ODS_MD_AREAS="
LOAD DATA INPATH '/warehouse/app_basic/t_md_areas' INTO TABLE jtp_app_ods.ods_md_areas PARTITION (dt = '${data_str}');
"
/opt/module/spark/bin/beeline -u jdbc:hive2://node101:10001 -n bwie -e '${HDFS_ODS_MD_AREAS}'